package com.jlstu.designmodedemo.abstracthandler.handler;

import com.jlstu.designmodedemo.abstracthandler.AbstractColaHandler;
import com.jlstu.designmodedemo.factory.ColaFactory;
import org.springframework.stereotype.Component;

@Component
public class WahahaHandler extends AbstractColaHandler {
    @Override
    public void getCoca(String parameter) {
        System.out.println("我是娃哈哈可乐-策略+工厂+模板 " + parameter);
    }

    @Override
    public String wahahaMethod(String name) {
        return "娃哈哈可乐WahahaHandler独有";
    }

    @Override
    public String invokeCommon() {
        return "我是WahahaHandler统一实现抽象父类的invokeCommon方法";
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        ColaFactory.register("Wahaha", this);
    }

}